package com.sujiewon.salesadmin.maintain.dao;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;

@Repository
public class MaintainDaoImpl implements MaintainDao {
	
	@Resource(name="sqlMapClient")
	private SqlMapClient sqlMapClient;	

	@SuppressWarnings("unchecked")
	@Override
	public HashMap<String, Object> getCustCtrtMatn(HashMap<String, Object> paramMap) throws SQLException {
		return (HashMap<String, Object>) this.sqlMapClient.queryForObject("maintain.getCustCtrtMatn", paramMap);
	}

	@Override
	public void registerCustCtrtMatn(HashMap<String, Object> paramMap) throws SQLException {
		this.sqlMapClient.insert("maintain.insertCustCtrtMatn", paramMap);
	}

	@Override
	public void updateCustCtrtMatn(HashMap<String, Object> paramMap) throws SQLException {
		this.sqlMapClient.update("maintain.updateCustCtrtMatn", paramMap);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<HashMap<String, Object>> getProjectMatnList(HashMap<String, Object> paramMap) throws SQLException {
		return this.sqlMapClient.queryForList("maintain.getMatnCtrtInfo", paramMap);
	}

	@SuppressWarnings("unchecked")
	@Override
	public HashMap<String, Object> getMatnMgrInfo(HashMap<String, Object> paramMap) throws SQLException {
		return (HashMap<String, Object>) this.sqlMapClient.queryForObject("maintain.getMatnMgrInfo", paramMap);
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List<HashMap<String, Object>> getMatnMgrInfoList(HashMap<String, Object> paramMap) throws SQLException {
		return this.sqlMapClient.queryForList("maintain.getCustMatnMgrInfo", paramMap);
	}

	@Override
	public void registerMatnMgr(HashMap<String, Object> paramMap) throws SQLException {
		this.sqlMapClient.insert("maintain.insertMatnMgr", paramMap);
	}

	@Override
	public void updateMatnMgr(HashMap<String, Object> paramMap) throws SQLException {
		this.sqlMapClient.update("maintain.updateMatnMgr", paramMap);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<HashMap<String, Object>> getCustMatnSvcList(HashMap<String, Object> paramMap) throws SQLException {
		return this.sqlMapClient.queryForList("maintain.getMatnSvcList", paramMap);
	}

	@Override
	public void registerMatnSvc(HashMap<String, Object> paramMap) throws SQLException {
		this.sqlMapClient.insert("maintain.insertMatnSvc", paramMap);
	}

	@Override
	public void updateMatnSvc(HashMap<String, Object> paramMap) throws SQLException {
		this.sqlMapClient.update("maintain.updateMatnSvc", paramMap);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<HashMap<String, Object>> getProjectCtrtMatnList(HashMap<String, Object> paramMap) throws SQLException {
		return this.sqlMapClient.queryForList("maintain.getProjectCtrtMatn", paramMap);
	}

	@Override
	public void changeStatusCustCtrtMatn(HashMap<String, Object> paramMap) throws SQLException {
		this.sqlMapClient.update("maintain.changeStatusCustCtrtMatn", paramMap);
	}

	@Override
	public int totalCountProjectCtrtMatnList(HashMap<String, Object> paramMap) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject("maintain.totalCountProjectCtrtMatn", paramMap);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<HashMap<String, Object>> getMatnListInfo(HashMap<String, Object> paramMap) throws SQLException {
		return this.sqlMapClient.queryForList("maintain.getMatnListInfo", paramMap);
	}

	@Override
	public int totalCountMatnList(HashMap<String, Object> paramMap) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject("maintain.totalCountMatnList", paramMap);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<HashMap<String, Object>> getCtrtMatnReport(HashMap<String, Object> paramMap) throws SQLException {
		return this.sqlMapClient.queryForList("maintain.getCtrtMatnReport", paramMap);
	}

	@Override
	public int totalCountMatnReport(HashMap<String, Object> paramMap) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject("maintain.totalCountMatnReport", paramMap);
		
	}

}
